-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
117 delay option for new set of key signing #118
117 delay option for new set of key signing #118
Conversation
JaCoCo code coverage report - scala:2.12.17
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Most of the comments are details, but adding tests to the AwsSecretsManagerKeyConfig seem necessary
keyPhaseOutTime: Option[FiniteDuration], | ||
keyLayOverTime: Option[FiniteDuration] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
keyPhaseOutTime: Option[FiniteDuration], | |
keyLayOverTime: Option[FiniteDuration] | |
keyLayOverTime: Option[FiniteDuration], | |
keyPhaseOutTime: Option[FiniteDuration] |
Same reason as above.
@@ -79,7 +80,15 @@ case class AwsSecretsManagerKeyConfig( | |||
} | |||
} | |||
|
|||
(currentKeyPair, previousKeyPair) | |||
previousKeyPair.fold {(currentKeyPair, previousKeyPair)} { pk => | |||
val exp = keyLayOverTime.exists(!isExpired(currentSecrets.createTime, _)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
val exp = keyLayOverTime.exists(!isExpired(currentSecrets.createTime, _)) | |
val layoverIsActive = keyLayOverTime.exists(!isExpired(currentSecrets.createTime, _)) |
I think better names denoting more closely what is meant would be welcome. Same with
val exp = keyPhaseOutTime.exists(isExpired(currentSecrets.createTime, _))
(perhaps rename to val phaseOutIsActive
)?
api/src/main/scala/za/co/absa/loginsvc/rest/config/jwt/AwsSecretsManagerKeyConfig.scala
Outdated
Show resolved
Hide resolved
api/src/test/scala/za/co/absa/loginsvc/rest/service/jwt/JWTServiceTest.scala
Outdated
Show resolved
Hide resolved
README.md
Outdated
t=15-29m: layover is over: new key from after rotation is used for signing. Both public keys available from public-keys endpoint. | ||
t=30m+: phase-out happens: new key from after rotation is used for signing. Old Key is no longer available from public-keys endpoint. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
t=15-29m: layover is over: new key from after rotation is used for signing. Both public keys available from public-keys endpoint. | |
t=30m+: phase-out happens: new key from after rotation is used for signing. Old Key is no longer available from public-keys endpoint. | |
t=15-44m: layover is over: new key from after rotation is used for signing. Both public keys available from public-keys endpoint. | |
t=45m+: phase-out happens: new key from after rotation is used for signing. Old Key is no longer available from public-keys endpoint. |
Since now you have made phase-out window to be counted after the layover is concluded.
README.md
Outdated
t=15-29m: layover is over: new key from after rotation is used for signing. Both public keys available from public-keys endpoint. | ||
t=30m+: phase-out happens: new key from after rotation is used for signing. Old Key is no longer available from public-keys endpoint. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
t=15-29m: layover is over: new key from after rotation is used for signing. Both public keys available from public-keys endpoint. | |
t=30m+: phase-out happens: new key from after rotation is used for signing. Old Key is no longer available from public-keys endpoint. | |
t=15-44m: layover is over: new key from after rotation is used for signing. Both public keys available from public-keys endpoint. | |
t=45m+: phase-out happens: new key from after rotation is used for signing. Old Key is no longer available from public-keys endpoint. |
Same as above, I think
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just some details (code quality/readability improvements)
Release Notes:
closes #117